import {request} from '@umijs/max';
import {OrganizationOrderListItem} from "@/pages/order/list/data";
import {ResourceListItem} from "@/pages/power/resource-activate/data";

/** 新增租户 POST /api/dataCenter/add */
export async function organizationOrderAdd(data: { [key: string]: any }, options?: { [key: string]: any }) {
    return request<OrganizationOrderListItem>('/api/order/create', {
        data,
        method: 'POST',
        ...(options || {}),
    });
}


/** 获取租户列表 GET /api/dataCenter/list */
export async function resourceSelectList(
    params: {
        name?: string;
        dataCenterId: string;
        resourceType: string;
    },
    options?: { [key: string]: any },
) {
    return request<{
        data: ResourceListItem[];
        /** 列表的内容总数 */
        total?: number;
        success?: boolean;
    }>('/api/order/resourceSelectList', {
        method: 'GET',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}

